package com.echo.fm.platform.auth;

import java.util.List;

import org.hibernate.criterion.Criterion;

import com.echo.fm.content.systemAction.model.SystemAction;
import com.echo.fm.platform.auth.model.Authority;
import com.echo.fm.platform.auth.model.LoginPass;
import com.echo.fm.platform.auth.model.RoleAuth;
import com.echo.fm.platform.auth.model.SystemUser;
import com.echo.fm.user.role.model.Role;
import com.echo.util.ErrorException;

public interface IAuthService {

	boolean authority(String token, String action);

	SystemUser searchSystemUserByUsername(String userName) throws ErrorException;

	boolean checkPassword(String uid, String password) throws ErrorException;

	void registSystemUser(String userName, String password, String phone) throws ErrorException;

	String login(String username, byte[] md5) throws ErrorException;

	Authority searchAuthorityByUId(String uid) throws ErrorException;

	Authority searchAuthorityByToken(String token) throws ErrorException;

	List<Authority> searchAuthorityList(boolean isTest) throws ErrorException;

	List<Authority> searchAuthorityList() throws ErrorException;

	void updateAuthority(Authority auth) throws ErrorException;

	String searchUserIdByUsername(String username) throws ErrorException;

	LoginPass searchLoginPassByUId(String userId) throws ErrorException;

	List<RoleAuth> listRoleAuth(Integer roleId) throws ErrorException;

	List<Role> searchRoleList(List<Criterion> criterions) throws ErrorException;

	List<Role> searcheRoleList(SystemUser user) throws ErrorException;

	boolean checkLogin(String id, String password) throws ErrorException;

	List<SystemAction> getAllSystemActions() throws ErrorException;

	boolean checkAppLogin(String uid, String password) throws ErrorException;

}
